import request from '@/utils/request'
/**
 * @登录接口
 * @url /makeid-boot/app/login
 * @param {type} data
 */
export function login(data) {
  return request.get('/server/WeChat/v1/api/mini-login', {params:data})
}
/**
 * @登录接口
 * @url /server/PCenter/v1/api/expert_info
 * @param {type} data
 */
export function getUserMessage(data) {
	let url = ""
	switch (data){
		case "Teacher":
			url = "/server/PCenter/v1/api/teacher_info" 
			break;
		case "Student":
			url = "/server/PCenter/v1/api/student_info" 
			break;
		case "Expert":
			url = "/server/PCenter/v1/api/expert_info" 
			break;
		default:
			break;
	}
  return request.get(url)
}
/**
 * @手机绑定
 * @url /server/WeChat/v1/api/phone-bind
 * @param {type} data
 */
export function phoneBind(data) {
  return request.post('/server/WeChat/v1/api/phone-bind', data)
}


/**
 * @实验列表
 * @url /server/Experiment/v1/api/my-experiments
 * @param {type} data
 */
export function experimentsList(data) {
  return request.get('/server/Experiment/v1/api/my-experiments', data)
}

/**
 * @实验计划
 * @url /server/Experiment/v1/api/plan/
+ +  @param {type} data
 */
export function experimentsPlan(data) {
  return request.get('/server/Experiment/v1/api/plan/'+ data)
}

/**
 * @实验进展
 * @url /server/Progress/v1/api/list/
+ +  @param {type} data
 */
export function experimentsProgress(data) {
  return request.get('/server/Progress/v1/api/list/'+ data,{
	  params:{
	  	page:1,
	  	limit:100
	  }
  })
}

/**
 * @实验进展
 * @url /server/Progress/v1/api
+ +  @param {type} data
 */
export function ProgressDetail(data) {
  return request.get('/server/Progress/v1/api/'+ data)
}

/**
 * @实验实时数据
 * @url /server/Device/v1/api/chart/
+ +  @param {type} data
 */
export function experimentsData(data) {
  return request.get('/server/Device/v1/api/rtime/'+ data)
}
/**
 * @实验实时数据图
 * @url /server/Device/v1/api/chart/
+ +  @param {type} data
 */
export function experimentsEcharts(data) {
  return request.get('/server/Device/v1/api/chart/'+ data)
}
/**
 * @实验拍摄视频
 * @url /server/Live/v1/api/play-url/
+ +  @param {type} data
 */
export function experimentsVideo(data) {
	return request.get('/server/Live/v1/api/play-url/'+ data + '?type=HLS')
}

/**
 * @获取评论列表
 * @url /server/Comment/v1/api/list/{objectId}
+ +  @param {type} data
 */
export function experimentsCommentList(data) {
	return request.get('/server/Comment/v1/api/list/'+data,{
		params:{
			type:'time',
			page:1,
			limit:30
		}
	})
}
/**
 * @获取评论列表
 * @url /server/Comment/v1/api/insert/{objectId}
+ +  @param {type} data
 */
export function experimentsSubmitCommentList(data,content) {
	return request.post('/server/Comment/v1/api/insert/'+data,{
		content,
		type: "Progress",
	})
}

/**
 * @进程点赞
 * @url /server/LikeRecord/v1/api/{objectId}
+ +  @param {type} data
 */
export function experimentsLike(data) {
	return request.put('/server/LikeRecord/v1/api/'+data +'?type=progress')
}

export function experimentsDisLike(data) {
	return request.delete('/server/LikeRecord/v1/api/'+data +'?type=progress')
}
// 获取专家指导
export function expertGuide(id,data) {
	return request.get('/server/Experiment/v1/api/expert-guide/'+id,{
		params:data
	})
}
// 对实验提问
export function insertQuestion(id,data) {
	return request.post('/server/Question/v1/api/insert-experiment/'+id,data)
}

// 获取问题列表
export function questionList(id,data) {
	return request.get('/server/Question/v1/api/list-experiment/'+id,{
		params:data
	})
}
// 获取我的问题列表
export function myQuestionList(data) {
	return request.get('/server/PCenter/v1/api/my-question-list',{
		params:data
	})
}

// 获取问题详情
export function questionDetail(id) {
	return request.get('/server/Question/v1/api/'+id)
}
// 获取问题详情
export function resourceDetail(id,type) {
	if(type == '1'){
		// return request.get('/server​/Resource​/v1​/api​/detail​?id=' + id)
		return request.get('/server/Resource/v1/api/detail/'+id)
	}else{
		return request.get('/server/RongHeJYInfo/v1/api/detail/'+id)
	}
}

// GrowPerception 成长感悟分页
export function growPerceptionQuery(data) {
	return request.post('/server/GrowPerception/v1/api/query',data)
}
 // 获取 耕种资讯
export function hostNews(info) {
	return request.get('/server/Progress/v1/api/list-news', {
			params:info
	})
}